package com.ulic.customerManApplication.documentmodule.service.impl;

import javax.annotation.Resource;

import org.springframework.stereotype.Component;

import com.ulic.customerManApplication.documentmodule.bo.Document;
import com.ulic.customerManApplication.documentmodule.dao.DocumentDao;
import com.ulic.customerManApplication.documentmodule.service.DocumentService;
import com.ulic.customerManApplication.documentmodule.vo.DocumentVO;
import com.ulic.customerManApplication.pager.PagerModel;

@Component("documentService")
public class DocumentServiceImpl implements DocumentService {

	
	private DocumentDao documentDao;
	
	public DocumentDao getDocumentDao() {
		return documentDao;
	}
	@Resource
	public void setDocumentDao(DocumentDao documentDao) {
		this.documentDao = documentDao;
	}

	@Override
	public Document getDocument(int id) {
		// TODO Auto-generated method stub
		return documentDao.getDocument(id);
	}

	@Override
	public PagerModel getDocuments(int curPage) {
		// TODO Auto-generated method stub
		return documentDao.getDocuments(curPage);
	}

	@Override
	public void addDocument(Document document) throws Exception {
		// TODO Auto-generated method stub

		documentDao.insertDocument(document);
	}
	@Override
	public PagerModel getDocuments(DocumentVO documentVO, int curPage) {
		// TODO Auto-generated method stub
		return documentDao.getDocuments(documentVO, curPage);
	}
	@Override
	public void removeDocument(Document document) {
		// TODO Auto-generated method stub
		documentDao.deleteDocument(document);
	}

}
